package exo4;

import java.util.ArrayList;
import java.util.List;

public class Abonne {
	private String nom;
	private String adresse;
	private List<Ouvrage> reservations;
	private List<Ouvrage> emprunts; 
	
	public Abonne(){
		reservations = new ArrayList<Ouvrage>();
		emprunts = new ArrayList<Ouvrage>();
	}

	public Abonne(String nom, String adresse, List<Ouvrage> reservations, List<Ouvrage> emprunts) {
		this.nom = nom;
		this.adresse = adresse;
		this.reservations = reservations;
		this.emprunts = emprunts;
	}
	
	public Abonne(String nom, String adresse) {
		this();
		this.nom = nom;
		this.adresse = adresse;
	}
	
	public String getNom() {
		return nom;
	}

	public void setNom(String nom) {
		this.nom = nom;
	}

	public List<Ouvrage> getReservations() {
		return reservations;
	}

	public void setReservations(List<Ouvrage> reservations) {
		this.reservations = reservations;
	}

	public List<Ouvrage> getEmprunts() {
		return emprunts;
	}

	public void setEmprunts(List<Ouvrage> emprunts) {
		this.emprunts = emprunts;
	}

	@Override
	public String toString() {
		StringBuffer sb = new StringBuffer();
		sb.append("nom : ").append(this.nom).append(", adresse : ")
				.append(this.adresse).append("\n ouvrages réservés : ")
				.append(this.reservations).append("\n ouvrages empruntés : ")
				.append(this.emprunts).append("\n");
		return sb.toString();
	}
}
